using IQIGame.Onigao.Game;
using IQIGame.Onigao.Logic;

namespace IQIGame.Onigao.GamePlay
{
    public class CFSMCond_Level_Logic_Monster_IsHeroInPhysicalArea : CFSMConditionFunc<IQIGame.Onigao.Logic.LevelEntity, CFSMLevel_Logic_MonsterData>
    {
        protected override void OnInit()
        {

        }

        public System.Boolean GetValue()
        {
            LevelHeroEntity heroEntity = data.lockingEntity;
            //怪物状态机判断玩家是否在物理区域时，如果找不到追击的玩家，和玩家进入了物理区域时相同的逻辑
            if (heroEntity == null)
            {
                return true;
            }
            return heroEntity.navigator.isPhysical;
        }

        public override bool Check()
        {
            return Compare(GetValue());
        }

        public override void OnReset()
        {
            base.OnReset();
        }
    }
}
